package controller

import (
	"AiBus/request"
	"AiBus/service"
	"AiBus/utils"
	"github.com/gin-gonic/gin"
)

// @Summary 配置邮箱信息
// @Success 200 {string} string json{"code","message"}
// @Param Authorization	header string true "Bearer xxxxxx"
// @Param data body request.SystemParameter{} true "配置邮箱信息添加参数"
// @Router /api/system/system_parameter_email [post]
// @version 1.0
func AddMail(c *gin.Context) {
	req := request.SystemParameter{}
	if err := c.ShouldBind(&req); err != nil {

		utils.Fail(c, 405, "参数传递错误")

	} else {
		UserID := c.GetString("open_id")

		service.SystempPrameter(c, req, UserID)

	}
}

// @Summary 系统所有配置信息加载
// @Param Authorization	header string true "Bearer xxxxxx"
// @Success 200 {string} string json{"code","message"}s
// @Router /api/system/get_all_system [get]
// @version 1.0
func GetAllSystem(c *gin.Context) {
	UserID := c.GetString("open_id")
	service.GetAllSystem(c, UserID)
}
